Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Docker stats POC #4862

Closed
wants to merge 1 commit into from
Closed

Docker stats POC #4862

wants to merge 1 commit into from

Conversation

Wiezzel
Copy link

@Wiezzel Wiezzel commented Nov 6, 2019

Run e.g.

./scripts/docker_stats_poc.py busybox "sh -c 'while true; do echo dupa; sleep 1; done'"

Should print something like this:

Kernel: 0.000 s User: 0.200 s Total: 0.208 s Memory: 0.637 MiB
Kernel: 0.000 s User: 0.200 s Total: 0.209 s Memory: 0.641 MiB
Kernel: 0.000 s User: 0.200 s Total: 0.210 s Memory: 0.637 MiB
Kernel: 0.000 s User: 0.200 s Total: 0.210 s Memory: 0.637 MiB
Kernel: 0.000 s User: 0.200 s Total: 0.211 s Memory: 0.516 MiB
...

Hit CTRL+C to stop.

@Wiezzel Wiezzel added the clay label Nov 6, 2019
@Wiezzel Wiezzel self-assigned this Nov 6, 2019
Copy link
Contributor

@maaktweluit maaktweluit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Some small comments.

Would move this file to scripts/task_api together with the basic integration tests if it will stay.

f'Memory: {(mem / 1024 / 1024):.3f} MiB')
except KeyError:
# The last message in the stream usually raises KeyError
print('Wrong stats format')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add if status == running here to, so it can be an "error" while running and a info ( or no message ) when its not

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea.
However, I'm not sure if the last message is sent after the container is stopped or just before. Need to check it.

@maaktweluit maaktweluit self-requested a review November 7, 2019 14:13
@codecov
Copy link

codecov bot commented Nov 7, 2019

Codecov Report

Merging #4862 into develop will increase coverage by 0.91%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #4862      +/-   ##
===========================================
+ Coverage     89.2%   90.11%   +0.91%     
===========================================
  Files          231      231              
  Lines        21263    21250      -13     
===========================================
+ Hits         18967    19150     +183     
+ Misses        2296     2100     -196

@mfranciszkiewicz
Copy link
Contributor

Merged in #4901

@Wiezzel Wiezzel deleted the docker_stats_poc branch May 22, 2020 09:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants